// room状态管理
const state = {
  refresh_room: '', // 刷新房间参数
  refresh: '', // 刷新电表参数
  refresh_vistor: '' // 刷新访客
}

const types = {
  REFRESH_ELEMETER: 'refresh_elemeter', // 刷新电表
  REFRESH_ROOM: 'refresh_room', // 刷新房间
  REFRESH_VISTOR: 'refresh_vistor' // 刷新访客
}

const mutations = {
  [types.REFRESH_ELEMETER] (state, data) {
    state.refresh = data
  },
  [types.REFRESH_ROOM] (state, data) {
    state.refresh_room = data
  },
  [types.REFRESH_VISTOR] (state, randomValue) {
    state.refresh_vistor = randomValue
  }
}

// const actions = {
//     updateRoomInfo({ commit }){ //调用解绑接口之后刷新
//         setTimeout(() => { commit('refresh_room', Math.random()) }, 1000)
//     }
// }

export default {
  state,
  mutations
  // actions
}
